package com.chinairi.mall.controller;


import com.chinairi.common.utils.ResponseUtil;
import com.chinairi.mall.model.News;
import com.chinairi.mall.service.INewsService;
import com.chinairi.mall.service.modelobject.OCTAForSPMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.chinairi.common.controller.BaseController;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Webgasd
 * @since 2020-10-19
 */
@RestController
@RequestMapping("/news")
public class NewsController extends BaseController {

    @Autowired
    private INewsService iNewsService;

    @GetMapping("/getList")
    @ResponseBody
    public void getList() throws IOException {
        List<News> newsList = iNewsService.getList();
        ResponseUtil.showMessage("success", "请求成功", newsList);
    }
}
